<?php

declare(strict_types=1);

namespace App\Controller\api;

use App\Controller\ApiBaseController;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\PostMapping;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;

/**
 * @Controller(prefix="patient")
*/
class PatientOrderController extends ApiBaseController
{
    /**
     * @Inject()
     * @var \App\Service\OrderService
    */
    private $orderService;
    /**
     * @RequestMapping(path="im/orders", methods={"get"})
    */
    public function imOrders(RequestInterface $request, ResponseInterface $response)
    {

        $userId = $request->input("userId");
        $fromType = $request->input("fromType");

        $orders = $this->orderService->getImOrderList($userId,$fromType);

        return $this->response->json($orders);
    }
}
